<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />

<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo"
	cellspacing="1">
	<col style="width: 20%" />
	<col style="width: 30%" />
	<col style="width: 20%" />
	<col style="width: 30%" />
	<tr >
		<td  colspan="4" class="t_bar2">基本信息</td>
		
	</tr>
	<tr >
		<td   align="right" width="20%"><span class="color_red">*</span>项目名称：</td>
		<td  colspan="3">
			<input id="zh_title" name="proposal/zh_title" label="项目名称" type="text" required class="input_css required maxlength:100"  style="width: 725px;" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title" />"/> 
		</td>
	</tr>
	<tr >
		<td   align="right" width="20%">项目类别：</td>
		<td  colspan="3">
			<x:out select="$xmlData/data/proposal/sub_grant_name" /> 
		</td>
	</tr>
	
	<tr >
		<td   align="right" width="20%"><span class="color_red">*</span>基层科技主管部门：</td>
		<td  colspan="3">
			<input id="kj_org_name" name="proposal/kj_org_name" label="基层科技主管部门" type="text" required class="input_css required"  style="width: 725px;" maxlength="100" value="<x:out select="$xmlData/data/proposal/kj_org_name" />"/> 
		</td>
	</tr>
	
	
	
	<tr >
	<td  align="right" nowrap><span class="color_red">*</span>申报领域：</td>
	<td>
	       <c:set var="statYear">${statYear}</c:set>
			 <c:if test="${empty statYear}">
			<c:set var="statYear"><x:out select="$xmlData/data/proposal/stat_year" /></c:set>
				</c:if>
			 <c:set var="grantCode"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
			 <%--
			<c:set var="domain_value"><x:out select="$xmlData/data/proposal/domain_value" /></c:set>
			<cpt:checkbox key="grant_domain" name="domain" repeatColumn="4"  sqlParamVal="{'grant_code':'${grantCode}'}"></cpt:checkbox>
			<input type="hidden" name="proposal/domain_value" class="required"  value="${domain_value}" label="申报领域">
			<input type="hidden" name="proposal/domain_name" value="<x:out select="$xmlData/data/proposal/domain_name" />"> --%>
			
			<c:set var="sub"><x:out select="$xmlData/data/proposal/sub_grant_code" /></c:set>
			<c:set var="domain">{'id':'<x:out select="$xmlData/data/proposal/domain_value" />','name':'<x:out select="$xmlData/data/proposal/domain_name" />'}</c:set>
          	<cpt:tree key="domain1" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${domain}"  label="申报领域"
          		id="domain" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue3" sqlParamVal="{grant_code:	${sub},stat_year:${statYear}}"/>
	        <input id="domain_value" type="hidden" name="proposal/domain_value" class="required" label="申报领域" value="<x:out select="$xmlData/data/proposal/domain_value" />"/>
            <input id="domain_name" type="hidden" name="proposal/domain_name"  value="<x:out select="$xmlData/data/proposal/domain_name" />"/>
	</td>
	<td align="right"><span class="color_red">*</span>是否自有科技成果：</td>
		<td valign="middle">
			<label> <input type="radio"  id="subject_type_value1" style="vertical-align: middle;" name="subject_type" label="是" value="01" onclick="changePrpAttach()"/><span style="vertical-align: middle;">是</span></label>&nbsp;&nbsp;
		 	<label> <input type="radio"  id="subject_type_value2" style="vertical-align: middle;" name="subject_type" label="否" value="02" onclick="changePrpAttach()"/><span style="vertical-align: middle;">否</span></label>
			<input type="hidden" name="proposal/subject_type_value" id="subject_type_value"  class="required"  value="<x:out select="$xmlData/data/proposal/subject_type_value" />" label="是否自有科技成果" /> 
			<input type="hidden" name="proposal/subject_type_name" id="subject_type_name" value="<x:out select="$xmlData/data/proposal/subject_type_name" />"  />
		</td>
	</tr>
	<tr>
		<td align="right" nowrap><span class="color_red">*</span>产学研联合：</td>
		<td colspan="3">
		 	<label> <input type="radio" class="do " id="advant_03" style="vertical-align: middle;" name="cxylh" label="是" value="04" /><span style="vertical-align: middle;">是</span></label>&nbsp;&nbsp;
		 	<label> <input type="radio" class="do " id="advant_03" style="vertical-align: middle;" name="cxylh" label="否" value="05" /><span style="vertical-align: middle;">否</span></label>
			<input type="hidden" name="proposal/cxylh_value" id="cxylh_value" class="required" value="<x:out select="$xmlData/data/proposal/cxylh_value" />" label="产学研联合" /> 
			<input type="hidden" name="proposal/cxylh_name" id="cxylh_name" value="<x:out select="$xmlData/data/proposal/cxylh_name" />" />
		</td>
	</tr>
	<%-- <!-- tr style="display:none"></tr> -->
	<tr >
	<td align="right"><span class="color_red">*</span>学科名称：</td>
   <td  colspan="3">
          	<c:set var="subject">{'id':'<x:out select="$xmlData/data/proposal/subject_code" />','name':'<x:out select="$xmlData/data/proposal/subject_name" />'}</c:set>
          	<cpt:tree key="medically" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${subject}"  label="学科名称"
          		id="subject" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue2"/>
	        <input id="subject_code" type="hidden" name="proposal/subject_code" class="required" label="学科名称" value="<x:out select="$xmlData/data/proposal/subject_code" />"/>
            <input id="subject_name" type="hidden" name="proposal/subject_name"  value="<x:out select="$xmlData/data/proposal/subject_name" />"/>
   </td>
	</tr> --%>
	<tr >
		<td align="right"><span class="color_red">*</span>归口管理部门：</td>
		<td colspan="3">
			<c:set var="recomend_org"><x:out select="$xmlData/data/proposal/recomend_org_value" /></c:set>
			<c:set var="sqOrgCode"><x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/></c:set>
			<cpt:select id="recomend_org"   sqlParamVal="{currentorgcode:${sqOrgCode }}"  key="proposal_tjbm"  value="${recomend_org}" onChange="initControlValue(this.id);" style="width:132px;"></cpt:select>
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required" value="${recomend_org}" label="归口管理部门">
			<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
		</td>
	</tr>
	<tr >
	<td  align="right" ><span class="color_red">*</span>起始时间：</td>
		<td >
			<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className="required date  dateCompare:end_date" label="起始时间" ></cpt:date> 
		</td>
		<td  align="right"><span class="color_red">*</span>终止时间：</td>
		<td>
			<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
			<cpt:date id="end_date" name="proposal/end_date" className="required date" label="终止时间"  value="${end_date}" ></cpt:date> 
		</td>
	</tr>
	<tr >
	    <td  align="right" nowrap width="20%"><span class="color_red">*</span>申报日期：</td>
		<td colspan="3">
			<c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="submit_date" name="proposal/submit_date" value="${submit_date}" className=" required date" label="申报日期"></cpt:date> 
		</td>
	</tr>
	</table>
	
	<jsp:include page="../org/prporg_hzdw2014.jsp">
		<jsp:param value="${param.xmlstr}" name="xmlstr" />
		<jsp:param value="111" name="addLimit10"/>
	</jsp:include>

<table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1" id="headname">
	<col style="width: 20%" />
	<col style="width: 30%" />
	<col style="width: 20%" />
	<col style="width: 30%" />
	<tr>
			<td class="t_bar2" colspan="4">项目负责人</td>
	</tr>
	
	<tr>
		<td align="right">姓名：</td>
		<td >
		    <span name="proposal/fzr_psnname" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
		</td>
		<td  align="right" >性别：</td>
		<td >
		    <span name="proposal/fzr_psnsex" >
		    	<c:set var="gender_value">
								<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/gender_value" />
							</c:set> <c:if test="${gender_value == 'M' }">男</c:if> <c:if
								test="${gender_value == 'F' }">女</c:if></span>
		    </span>
		</td>
	</tr>
	<tr>
		<td  align="right">学位：</td>
		<td >
		    <span name="proposal/fzr_degree_name" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/degree_name" /></span>
		</td>
		<td  align="right">出生日期：</td>
		<td >
		    <span name="proposal/fzr_birthday" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/birthday" /></span>
		</td>
	</tr>
	<tr>
		<td  align="right">职称：</td>
		<td >
		    <span name="proposal/fzr_prof_title_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/prof_title_name" /></span>
		</td>
		<td  align="right">职务：</td>
		<td >
		    <span name="proposal/fzr_position" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/position" /></span>
		</td>
		
	</tr>
	<tr>
	<td  align="right">从事专业：</td>
		<td colspan="3">
		    <span name="proposal/fzr_major_work" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/major_work" /></span>
		</td>
	</tr>
	<tr>
		<td align="right">所在单位：
		</td>
		<td colspan="3">
			 <span name="proposal/fzr_org_name" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/org_name" /></span>
		</td>
	</tr>
	<tr>
		<td  align="right">联系电话：</td>
		<td  >
		<span name="proposal/fzr_tel" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" /></span>
		</td>
		<td  align="right">手机号码：</td>
		<td  >
		<span name="proposal/fzr_mobile" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></span>
		</td>
	</tr>
	<tr>
		
		<td align="right">传真：</td>
		<td >
		<span name="proposal/fzr_fax"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/fax" /></span>
		</td>
		<td align="right">电子邮箱：</td>
		<td >
		<span name="proposal/fzr_mail"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span>
		</td>
	</tr> 
	</table>
	<table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1" id="contacts">
	<col style="width: 20%" />
	<col style="width: 30%" />
	<col style="width: 20%" />
	<col style="width: 30%" />
	<tr>
		<td  class="t_bar2" colspan="4">项目联系人</td>
	</tr>
	<tr>
		<td  align="right" ><span class="color_red">*</span>姓名：</td>
		<td >
			<input   name="proposal/contact_psn_cname" label="项目联系人信息-->姓名" type="text" required class="input_css required"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />"/> 
		</td>
		<td align="right" nowrap><span class="color_red">*</span>性别：</td>
		<td colspan="1">
		 	<label> <input type="radio" class="do " id="contact_sex_01" style="vertical-align: middle;" name="contact_sex" label="男" value="M" /><span style="vertical-align: middle;">男</span></label>&nbsp;&nbsp;
		 	<label> <input type="radio" class="do " id="contact_sex_02" style="vertical-align: middle;" name="contact_sex" label="女" value="F" /><span style="vertical-align: middle;">女</span></label>
			<input type="hidden" name="proposal/contact_sex_value" id="contact_sex_value" class="required" value="<x:out select="$xmlData/data/proposal/contact_sex_value" />" label="项目联系人信息-->性别" /> 
			<input type="hidden" name="proposal/contact_sex_name" id="contact_sex_name" value="<x:out select="$xmlData/data/proposal/contact_sex_name" />" />
		</td>
		
	</tr>
	<tr>
	<td  align="right" ><span class="color_red">*</span>职称：</td>
	<td colspan="1">
		    <c:set var="titlename">{'id':'<x:out select="$xmlData/data/proposal/prof_title_value" />','name':'<x:out select="$xmlData/data/proposal/prof_title_name" />'}</c:set>
			<cpt:tree key="prof_title" cacheable="false" readonly="true" value="${titlename}" id="prof_title" name="prof_title"  showPattern="all" shieldPattern="-1" onClick="initTreeValueExt"   label="职称" />
			<input type="hidden" id="prof_title_value" name="proposal/prof_title_value" value="<x:out select="$xmlData/data/proposal/prof_title_value" />" class="required"  label="项目联系人信息-->职称"/> 
			<input type="hidden" id="prof_title_name" name="proposal/prof_title_name" value="<x:out select="$xmlData/data/proposal/prof_title_name" />" />
			</td>
	<td  align="right" ><span class="color_red">*</span>职务：</td>
		<td >
			<input  name="proposal/contact_psn_position" label="项目联系人信息-->职务" type="text" required class="input_css required"   maxlength="50" value="<x:out select="$xmlData/data/proposal/contact_psn_position" />"/> 
		</td>
	</tr>
	<tr>
		
		<td  align="right"><span class="color_red">*</span>联系电话：</td>
		<td  >
			<input   name="proposal/contact_psn_tel_work" label="项目联系人信息-->联系电话" type="text" required class="input_css required"  maxlength="50" value="<x:out select="$xmlData/data/proposal/contact_psn_tel_work" />"/> 
		</td>
		<td  align="right"><span class="color_red">*</span>手机号码：</td>
		<td >
			<input   name="proposal/contact_psn_mobile" label="项目联系人信息-->手机号码" type="text" required maxlength="11"  class="input_css required mobile"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />"/> 
		</td>
	</tr>
	<tr>
		<td  align="right"><span class="color_red">*</span>传真：</td>
		<td  >
			<input   name="proposal/contact_psn_fax" label="项目联系人信息-->传真" type="text" required class="input_css required"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_fax" />"/> 
		</td>
		<td  align="right"><span class="color_red">*</span>电子邮箱：</td>
		<td  >
			<input   name="proposal/contact_psn_email" label="项目联系人信息-->电子邮箱" type="text" required class="input_css required email"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_email" />"/> 
		</td>
		
	</tr>
	
	</table>



<div class="t_bar"><span class="color_red">*</span>主要任务（限300字）</div>
   <table class="t_css" width="100%" border="0" cellpadding="0"  cellspacing="1"  id="contacts2">
      <tr >
          <td>
			<textarea rows="5" cols="127"  class="input_textarea required  maxlength:300"   name='proposal/goal/summary5'  label="主要任务"><x:out select="$xmlData/data/proposal/goal/summary5"/></textarea>
		   <input type='hidden' name='proposal/goal/summary5_hidden' id='proposal/goal/summary5_hidden' value=''>
		  </td>
      </tr>
    </table>
 <div class="t_bar"><span class="color_red">*</span>考核指标（限300字）</div>
   <table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1" id="contacts3">
      <tr >
          <td>
			<textarea rows="5" cols="127"  class="input_textarea required  maxlength:300"   name='proposal/goal/summary6'  label="考核指标"><x:out select="$xmlData/data/proposal/goal/summary6"/></textarea>
		   <input type='hidden' name='proposal/goal/summary6_hidden' id='proposal/goal/summary6_hidden' value=''>
		  </td>
      </tr>
    </table>
    <div class="t_bar"><span class="color_red">*</span>预期示范推广效果（限300字）</div>
   <table class="t_css" width="100%" border="0" cellpadding="0"  cellspacing="1" id="contacts4">
      <tr >
          <td>
			<textarea rows="5" cols="127"  class="input_textarea required  maxlength:300"   name='proposal/goal/summary7'  label="预期示范推广效果"><x:out select="$xmlData/data/proposal/goal/summary7"/></textarea>
		   <input type='hidden' name='proposal/goal/summary7_hidden' id='proposal/goal/summary7_hidden' value=''>
		  </td>
      </tr>
    </table>  


<script type="text/javascript">
$(function(){
	cydw('org1');
	cydw('org2');
	$("#basicInfo tr:even").addClass("li_1");
   $("#basicInfo tr:odd").addClass("li_2");
	
})
function cydw(id){
	var count =0 ;
	$("#"+id).find("input[type='text']").each(function(){
		if($.trim($(this).val()) != ''){
			count +=1;
		}
	});
	if(count != 0){
		$("#"+id).find("input[type='text']").each(function(){
			$(this).addClass("required");
		});
		$("#"+id).find("span[id^='color']").each(function(){
			$(this).css('display','');
		});
	}else{
		$("#"+id).find("input[type='text']").each(function(){
			$(this).removeClass("required");
	});
		$("#"+id).find("span[id^='color']").each(function(){
			$(this).css('display','none');
		});
	}
}

function setProjectPlace(op){
	var address = $("#address_value").val();
	if(op) address = '${address}';
	$("#address_name_other").removeClass("required");
	if(address == '02'){
		$("#address_name_other_span").show();
		$("#address_name_other").css("display","");
		$("#address_name_other").addClass("required");
	}else{
		$("#address_name_other_span").hide();
		$("#address_name_other").removeClass("required");
		$("#address_name_other").val("");
	}
}
function initTreeValue2CallBack(){
	cydw('org1');
	cydw('org2');
}
function setEmptyValueForTree(id){
	$("#"+id).val("");
	$("#"+id+"_hideId").val("");
	$("#"+id+"_hideName").val("");
	$("#"+id+"_code").val("");
	$("#"+id+"_value").val("");
	$("#"+id+"_name").val("");
	$("#"+id + ",[name$='/"+id+"_code']" + ",[name$='/"+id+"_name'],[name$='/"+id+"_value']").val("");
	$("#sqdm").val("");
	cydw('org1');
	cydw('org2');
}
function countFundInt(idStart, countStr, totalStr) {
	var indexs = countStr.split(",");
	var count = 0;
	for ( var i = 0; i < indexs.length; i++) {
		var fund = $("#" + idStart + indexs[i]).val();
		if (!$.isNumeric(fund))
			fund = 0;
		count = parseInt(count) + parseInt(fund);
	}
	//add by cg 扩展：对于多个输入框所求得的和，同时赋给某几个文本框
	var totalStrArr = totalStr.split(",");
	var totalId;
	for(var i = 0;i < totalStrArr.length; i++ ) {
		totalId = totalStrArr[i];
	$("#" + idStart + totalId).val(count);
	}
}
function initTreeValueExt(treeId, treeNode) {
	   
	  if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
		scmWarn($("#" + treeId).attr("label") + messageTip.researchAreaInvalidDisciplineCode);
		if (treeNode.level == 0) {
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
		}
		
		return false;
		}
	
	
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			obj = obj.parentNode;
		}
		
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val(str);
		
	}
	
function changePrpAttach(){
	 
	
	    if($("#subject_type_value1").attr("checked")){
	 
		  $("#berif25").html("否");
		   $("#berif28").html("否");
			 
			}else {
				 $("#berif25").html("是");
				$("#berif28").html("是");
		  }
	
}

</script>

